// 导入request:
import request from '@/utils/request'
// 用户登录：
export const userLogin = ({ mobile, code }) => {
  return request.post('/v1_0/authorizations', {
    mobile, code
  })
}
// 获取文章频道列表：
export const getArticleList = () => {
  return request.get('/v1_0/user/channels')
}
// 获取首页文章列表：
export const getArticle = data => {
  return request.get('/v1_0/articles', {
    params: {
      with_top: 1,
      channel_id: data.channel_id,
      timestamp: data.timestamp

    }
  })
}
// 获取短信验证码
export const getCode = mobile => {
  return request.get(`/v1_0/sms/codes/${mobile}`)
}
// 获取用户频道列表
export const getUserChannels = () => {
  return request.get('/v1_0/user/channels')
}
